#ifndef _SC_GPIO_H_
#define _SC_GPIO_H_

#include "..\Global.h"

//enum
//{
//    PIN0 = 0,
//    PIN1,
//    PIN2,
//    PIN3
//    PIN4,
//    PIN5,
//    PIN6,
//    PIN7,
//};

//#define PA   'A'
//#define PB   'B'
//#define PC   C
//#define PIN0 0
//#define PIN1 1
//#define PIN2 2
//#define PIN3 3
//#define PIN4 4
//#define PIN5 5
//#define PIN6 6
//#define PIN7 7

#define DEF_PIN(port, pin)          R##port##pin
#define DEF_PIN_DIR(port, pin)      TRIS##port##pin
#define DEF_PIN_WPU(port, pin)      WPU##port##pin



#define SET_INPUT_PULL_HIGH(PORT,PIN)   do{R##PORT##PIN = 1; TRIS##PORT##PIN = 1; WPU##PORT##PIN = 1;}while(0);
#define SET_INPUT(PORT,PIN)             do{TRIS##PORT##PIN = 1; WPU##PORT##PIN = 0;}while(0);
#define SET_OUTPUT_H(PORT,PIN)          do{R##PORT##PIN = 1; TRIS##PORT##PIN = 0; WPU##PORT##PIN = 0;}while(0);
#define SET_OUTPUT_L(PORT,PIN)          do{R##PORT##PIN = 0; TRIS##PORT##PIN = 0; WPU##PORT##PIN = 0;}while(0);


void    initGPIO(void);

#endif

